﻿using System;
using Core.Interfaces;
using Core.Model;

namespace Core.Services
{
    public class AccountService : IAccountService
    {
        private readonly IAccountRepository _accountRepository;
       
        public AccountService(IAccountRepository accountRepository)
        {
            if (accountRepository == null) throw new ArgumentNullException("accountRepository");
            _accountRepository = accountRepository;
        }

        public Account RetrieveAccount(string userId)
        {
            return _accountRepository.RetrieveAccount(userId);
        }


        public bool ValidateUser(string userId, string password)
        {
            return _accountRepository.ValidateUser( userId,  password);
        }
    }
}
